From: Jasper St. Pierre Date: Mon, 14 Oct 2013 04:00:24 +0000 (-0400) Subject: shell-global: Handle empty variants better X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3176 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c9b73ac7312774b4cfa7c40323f56b5bb9f8fdc8;p=gnome-shell.git shell-global: Handle empty variants better In cases where we have an array of 0 elements or similar, the data returned may be NULL. Since g_file_replace_contents will assert in this case, simply check for this and delete the file instead. https://bugzilla.gnome.org/show_bug.cgi?id=710137 --- diff --git a/src/shell-global.c b/src/shell-global.c index e711dff09..99aad50b8 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1770,7 +1770,7 @@ shell_global_set_runtime_state (ShellGlobal *global, path = get_runtime_state_path (global, property_name); - if (variant == NULL) + if (variant == NULL || g_variant_get_data (variant) == NULL) (void) g_file_delete (path, NULL, NULL); else {